﻿<%@ WebHandler Language="C#" Class="dream" %>

using System;
using System.Web;
using MindTouch.Dream;
using MindTouch.Tasking;

public class dream : Morange.Async.DreamAsyncHandler
{
    public override System.Collections.Generic.IEnumerator<IYield> Process(Morange.Async.AsyncCoreResult r, Result result)
    {
        Plug p = Plug.New(new XUri(ini.LongTaskUrl));
        Result<DreamMessage> res;
        yield return res = p.GetAsync();

        r.context.Response.Write(res.Value.ToText());
        result.Return();
        r.cb(r);
    }
}